<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script>
	function loginCheck(){
		var id = document.getElementById('userId').value;
		var password = document.getElementById('pass').value;
	
		validationCheck(id, password, 0, 12);
	} 
	
	function validationCheck(email, password, min, max) {
		if(email.length <= min || password.length > max){
			console.log("0000");
			return false;
		}
		else {
			return true;
			console.log("111");
		}
	}
	
	function totalTest() {
		$.ajax({
			url:'totaltest.jsp',
			method: 'post',
			success:function(html){
				$(".parsingPage").html(html);				
			},
			error:function(){
				alert("test Fail");	
			}
		});		
	}
	
	function boardList() {
		$.ajax({
			url : 'board.spring?action=boardList',
					
			success : function(html) {
				$("#navigation").html(html);
			}
		});
	}

    </script>
<nav class="mainNav cf">
	<c:if test="${login == null }">
		<div class="navigationLogin">
			<form id="navigationLoginForm" action="javascript:memberLogin();" accept-charset="utf-8" method="post"> <ul>
					<li><input type="text" id="userId" name="memberId" placeholder="아이디" size="12" required></li>
					<li><input type="password" id="pass" name="memberPassword" placeholder="패스워드" size="12" required></li>
				</ul>
				<div>
					<input type="submit" value="Login">
				</div>
				<div style="margin-top: 6px; height: 35px; padding: 3px;">
					<span><a href="javascript:memberAdd();">회원가입</a></span>
					<span><a href="javascript:memberIdSearch();">아이디/비밀번호 찾기</a></span>
				</div>
			</form>
		</div>

	</c:if>
	<c:if test="${login != null }">
		<div class="navigationLogin">
			<div>
				<span style="font-size: 17px; height: 52px; float: left; padding: 2px; width: 68px;">${login.memberNickname }
				</span>
				<p style="width: 18%; margin-top: 22px; float: left; font-weight: bold;">님</p>	
			</div>
			<div style="float: left; width: 80px;  height: 60px;">
				<span style="display: inline-block;">
					<p style="margin-left: -7px;"><a href="javascript:messageList();">쪽지 : </a></p>
					<p></p>
				</span>
				<span style="display: inline-block;">
					<h2 style="margin-left: -7px;">건강치 : ${login.healthpointTotal }</h2>
					<p style="float: left; width: 78px; display: inline-block; height: 18px; margin-left: -8px;"></p>
				</span>
			</div>
			<div>
				<div>
					<a style="margin: 0px 3px 0px 10px;" href="javascript:mypage('${login.memberId }');">마이페이지</a> 
					<a href="javascript:memberPreModify('${login.memberId }');">회원수정</a>
					<a href="member.spring?action=logout">로그아웃</a>
				</div>
			</div>
		</div>	
	</c:if>
	<div id="navBoard" align="center">
		<!-- 게시판 div -->
		<div>
			<c:forEach var="board" items="${boardList }">
				<c:if test="${board.boardClass == 'N' }">
					<p><a href="javascript:boardItemsList_N();">${board.boardName}</a></p>
				</c:if>
				
				<c:if test="${board.boardClass == 'P' }">
					<p><a href="javascript:albumBBS();">${board.boardName}</a></p>
				</c:if>
			</c:forEach>
		</div>
	</div>
</nav>

